#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100

int min(int a, int b) {
    return a < b ? a : b;
}

int max(int a, int b) {
    return a > b ? a : b;
}

int main() {
    int num, investTotal, riskTotal;
    scanf("%d%d%d", &num, &investTotal, &riskTotal);
    int eachReturn[MAX];
    int eachRisk[MAX];
    int eachMaxInvest[MAX];
    for(int i = 0; i < num; i++) {
        scanf("%d", &eachReturn[i]);
    }
    for(int i = 0; i < num; i++) {
        scanf("%d", &eachRisk[i]);
    }
    for(int i = 0; i < num; i++) {
        scanf("%d", &eachMaxInvest[i]);
    }
    // 记录最优选择
    int bestChoice[MAX] = {0};
    int bestReturn = 0;

    // 枚举选一个产品的最优选择
    for(int i = 0; i < num; i++) {
        int curReturn = 0;
        int curInvest = 0;
        if (riskTotal >= eachRisk[i]) {
            curInvest = min(investTotal, eachMaxInvest[i]);
            curReturn = curInvest * eachReturn[i];
            if (curReturn > bestReturn) {
                bestReturn = curReturn;
                memset(bestChoice, 0, sizeof(bestChoice));
                bestChoice[i] = curInvest;
            }
        }
    }

    // 枚举选两个产品的最优选择
    for(int i = 0; i < num; i++) {
        for(int j = i + 1; j < num; j++) {
            if (eachRisk[i] + eachRisk[j] <= riskTotal) {
                int curInvestI = 0;
                int curInvestJ = 0;
                int curReturn = 0;
                if (eachReturn[i] > eachReturn[j]) {
                    curInvestI = min(eachMaxInvest[i], investTotal);
                    curInvestJ = min(investTotal - curInvestI, eachMaxInvest[j]);
                    curInvestJ = max(curInvestJ, 0);
                    curReturn = curInvestI * eachReturn[i] + curInvestJ * eachReturn[j];
                }
                else {
                    curInvestJ = min(eachMaxInvest[j], investTotal);
                    curInvestI = min(investTotal - curInvestJ, eachMaxInvest[i]);
                    curInvestI = max(curInvestI, 0);
                    curReturn = curInvestI * eachReturn[i] + curInvestJ * eachReturn[j];
                }
                if (curReturn > bestReturn) {
                    bestReturn = curReturn;
                    memset(bestChoice, 0, sizeof(bestChoice));
                    bestChoice[i] = curInvestI;
                    bestChoice[j] = curInvestJ;
                }
            }
        }
    }
    printf("%d", bestChoice[0]);
    for(int i = 1; i < num; i++) {
        printf(" %d", bestChoice[i]);
    }
    return 0;
}